package com.ebanma.cloud.utils;
import com.ebanma.cloud.user.dao.po.User;
/**
 * @author wangxin
 * @version $ Id: UserHolder, v 0.1 2023/02/17 14:01 banma-0369 Exp $
 */
public class UserHolder {
    public static final ThreadLocal<User> tl=new ThreadLocal<User>();
    public static void saveUser(User user){
        tl.set(user);
        System.out.println(tl);
    }
    public static User getUser(){
       return tl.get();
    }
    public static void removeUser(){
        tl.remove();
    }
}
